#!/bin/sh
echo "🔍 Checking commit message format..."
npx commitlint --edit "$1"
if [ $? -ne 0 ]; then
  echo "❌ Commit message format is invalid. Please follow the conventional commit format:"
  echo "   feat: add new feature"
  echo "   fix: fix a bug"
  echo "   docs: update documentation"
  echo "   style: format code"
  echo "   refactor: refactor code"
  echo "   test: add tests"
  echo "   chore: update build process"
  exit 1
fi
echo "✅ Commit message format is valid!"
